package com.party.business.service.impl;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.stream.Collectors;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.party.business.domain.TQuestionType;
import com.party.business.domain.TreeSelectQutype;
import com.party.business.mapper.TQuestionTypeMapper;
import com.party.business.service.ITQuestionTypeService;

import com.party.common.core.domain.TreeSelect;
import com.party.common.core.domain.entity.SysDept;
import com.party.common.utils.DateUtils;
import com.party.common.utils.StringUtils;
import com.party.common.utils.spring.SpringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


/**
 * 试题类别Service业务层处理
 *
 * @author ruoyi
 * @date 2024-11-08
 */
@Service
public class TQuestionTypeServiceImpl extends ServiceImpl<TQuestionTypeMapper, TQuestionType>  implements ITQuestionTypeService
{
    @Autowired
    private TQuestionTypeMapper tQuestionTypeMapper;

    /**
     * 查询试题类别
     *
     * @param id 试题类别主键
     * @return 试题类别
     */
    @Override
    public TQuestionType selectTQuestionTypeById(String id)
    {
        return tQuestionTypeMapper.selectTQuestionTypeById(id);
    }

    /**
     * 查询试题类别列表
     *
     * @param tQuestionType 试题类别
     * @return 试题类别
     */
    @Override
    public List<TQuestionType> selectTQuestionTypeList(TQuestionType tQuestionType)
    {
        return tQuestionTypeMapper.selectTQuestionTypeList(tQuestionType);
    }

    /**
     * 新增试题类别
     *
     * @param tQuestionType 试题类别
     * @return 结果
     */
    @Override
    public int insertTQuestionType(TQuestionType tQuestionType)
    {
                tQuestionType.setCreateTime(DateUtils.getNowDate());
            return tQuestionTypeMapper.insertTQuestionType(tQuestionType);
    }

    /**
     * 修改试题类别
     *
     * @param tQuestionType 试题类别
     * @return 结果
     */
    @Override
    public int updateTQuestionType(TQuestionType tQuestionType)
    {
                tQuestionType.setUpdateTime(DateUtils.getNowDate());
        return tQuestionTypeMapper.updateTQuestionType(tQuestionType);
    }

    /**
     * 批量删除试题类别
     *
     * @param ids 需要删除的试题类别主键
     * @return 结果
     */
    @Override
    public int deleteTQuestionTypeByIds(String[] ids)
    {
        return tQuestionTypeMapper.deleteTQuestionTypeByIds(ids);
    }

    /**
     * 删除试题类别信息
     *
     * @param id 试题类别主键
     * @return 结果
     */
    @Override
    public int deleteTQuestionTypeById(String id)
    {
        return tQuestionTypeMapper.deleteTQuestionTypeById(id);
    }




}
